
# Tools
RM = rm -rf
MKDIR = mkdir -p
LD = g++

#Directories
SRCDIR = src
INCDIR = inc
OBJDIR = obj

# Files
BIN = plazza
LINK =

CXXFILES =	main.cpp	\
		Parser.cpp	\
		Core.cpp	\
		StdInput.cpp	\
		Kitchen.cpp

CFILES =

OBJS = $(patsubst %.c, $(OBJDIR)/%.c.o, $(notdir $(CFILES)))
OBJS += $(patsubst %.cpp, $(OBJDIR)/%.cpp.o, $(notdir $(CXXFILES)))

# Options
CFLAGS = -ggdb -W -Wall -Wextra
CXXFLAGS = -ggdb -W -Wall -Wextra
LDFLAGS = -pthread

$(BIN): makedirectories $(OBJS)
	$(LD) -o $(BIN) $(OBJS) $(LDFLAGS)

all: $(BIN)

$(OBJDIR)/%.c.o:	$(SRCDIR)/%.c
			$(CC) -c $(CFLAGS) -I $(INCDIR) -o $@ $<

$(OBJDIR)/%.cpp.o:	$(SRCDIR)/%.cpp
			$(CXX) -c $(CXXFLAGS) -I $(INCDIR) -o $@ $<

makedirectories:
	@$(MKDIR) $(OBJDIR)

clean:
	@$(RM) $(OBJS)
	@$(RM) $(OBJDIR)

fclean: clean
	@$(RM) $(BIN)

re: fclean all

.PHONY: re fclean clean
